package StudyCode.summary.zipfile;

import java.io.IOException;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ListContentsOfZipFile {
	public static void main(String args[]) {
		try {
			ZipFile zipFile = new ZipFile("E:/Copy/zipdemo.zip");

			Enumeration e = zipFile.entries();

			System.out.println("列出 Zip 文件内容");
			while (e.hasMoreElements()) {
				ZipEntry entry = (ZipEntry) e.nextElement();
				System.out.println(entry.getName());
			}

		} catch (IOException ioe) {
			ioe.printStackTrace();
		}

	}
}
